(defclass PERSON (is-a USER)
 (role abstract)
 (slot sex (access read-only)
  (storage shared))
 (slot age (type NUMBER)
  (create-accessor ?NONE)
  (visibility public)))

(defmessage-handler PERSON put-age (?value)
 (dynamic-put age ?value))

(defclass FEMALE (is-a PERSON)
 (role abstract)
 (slot sex (source composite)
  (default female)))

(defclass MALE (is-a PERSON)
 (role abstract)
 (slot sex (source composite)
  (default male)))

(defclass GIRL (is-a FEMALE)
 (role concrete)
 (slot age (source composite)
  (default 4)
  (range 0.0 17.9)))

(defclass WOMAN (is-a FEMALE)
 (role concrete)
 (slot age (source composite)
  (default 25)
  (range 18.0 100.0)))

(defclass BOY (is-a MALE)
 (role concrete)
 (slot age (source composite)
  (default 4)
  (range 0.0 17.9)))

(defclass MAN (is-a MALE)
 (role concrete)
 (slot age (source composite)
  (default 25)
  (range 18.0 100.0)))

(definstances PEOPLE
 (Man-1 of MAN (age 18))
 (Man-2 of MAN (age 60))
 (Woman-1 of WOMAN (age 18))
 (Woman-2 of WOMAN (age 60))
 (Woman-3 of WOMAN)
 (Boy-1 of BOY (age 8))
 (Boy-2 of BOY)
 (Boy-3 of BOY)
 (Boy-4 of BOY)
 (Girl-1 of GIRL (age 8))
 (Girl-2 of GIRL))

(reset)
